#ifndef __USART_
#define __USART_

#include "stm32f10x.h"
#include "stm32f10x_rcc.h"
#include "stm32f10x_gpio.h"
#include "stm32f10x_usart.h"
#include <string.h>

extern uint8_t sendbuf[60];
extern uint8_t receivebuf[60];
extern uint8_t usart_rec_length;

extern uint8_t usart_reg;
#define USART1_REG_RX_OK   (usart_reg&0x01>0?1:0)
#define USART1_REG_RX_Reset   (usart_reg&=~0x01)
#define USART1_REG_RX_Set   (usart_reg|=0x01)

extern void USART1_Init(uint32_t bps);
uint16_t usart1_dma_send(void* buffer, uint16_t size);
void USATR1_ByteTrans(uint8_t byte);
#endif

